import Reflux from 'reflux';
import StateMixin from 'reflux-state-mixin';
import operAction from 'pages/operator/actions/operAction.js';
import API from 'config/api';

export default Reflux.createStore({
  mixins:[StateMixin.store],
  listenables:[operAction],
  getInitialState() {
    return {
      items:[],
      freeUsers:[]
    };
  },
  onGetUsersList(name) {
    $.get(API.GET_OPERLIST(name),(data)=>{
      this.setState ({
        freeUsers:data.data
      });
    });
  }
})
